﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Data;
using Tools;
using Wp.DAL;

namespace Wp.BLL
{
    /// <summary>
    /// Summary description for Per_ActionsRoles
    /// </summary>
    public class TblTermsManager : TblTermsManagerBase
    {
        public TblTermsManager()
        {
            //
            // TODO: Add constructor logic here
            //
        }
        public static TblTermsManager CreateInstant()
        {
            return new TblTermsManager();
        }
       
        public TblTermsEntity SelectOneSlug(string Slug)
        {
            List<SqlParameter> ls = new List<SqlParameter>();
            
            ls.Add(new SqlParameter("@Slug", Slug));
            SqlParameter[] sqlparam = ls.ToArray();
            DataTable dt = SqlHelper.ExecuteDataTable(SqlHelper.WpConnectString, CommandType.StoredProcedure, "wp_SelectTblTermBySlug", sqlparam);
            if (dt != null && dt.Rows.Count > 0)
                return GetTblTermsEntity(dt.Rows[0]);
            return null;
        }
    }
}
